home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / pascal / mouslib8.zip / MOUSHELP.HDT < prev    next >
Text File  |  1993-02-25  |  11KB  |  288 lines

  1.  
  2.   mouseLib is a Turbo (Borland) Pascal 6.0+ mouse support unit, designed to 
  3.  provide event driven mouse support, using a standard (default) event 
  4.  handling mechanism. The unit includes all of the normal mouse library 
  5.  functions, (show, hide cursor, define tresh-hold, detect mouse etc..). 
  6.  mouseLib was used for over 3 years now, with many programs and products 
  7.  written by the author, and other programmers. Several mouseLib based packages 
  8.  are distributed by ISoft D&M, and can be downloaded for evaluation from BBSes 
  9.  around the world.
  10.  
  11. Related Topics : Technical Documentation Contact Registration Credits
  12.  
  13.  
  14.   Please contact :
  15.  
  16.   ISoft D&M,  
  17.   P.O.B 5517
  18.   Coralville IA 52241,
  19.   U.S.A
  20.  
  21.   To contact the author directly : 
  22.  
  23.   Contact :     Loewy Ron,
  24.                 9 Haneveem st.
  25.                 Herzeliya, 46465
  26.                 ISRAEL.
  27.  
  28. Related Topics : Overview Registration
  29.  
  30.  
  31.   mouseLib is a shareware product, if you find this product valuable, 
  32.  please register it. This section describes the reasones you should register.
  33.  
  34.   By registering mouseLib you will receive the latest mouseLib version. 
  35.   
  36.   By registering you will help us to create the next version
  37.  of mouseLib that will support more INT 33H functions, and will include even
  38.  more high-level support for TSRs, EVENT-DRIVEN programming, and more.
  39.  
  40. Related Topics : Contact Overview
  41.  
  42.  
  43. The mouse library package is built out of 3 different pascal units :
  44.  
  45. mouseLib - The core mouse support unit.
  46. tpDESQ     - DESQview support unit.
  47. video       - Video hardware support unit.
  48.  
  49. Related Topics : Overview Tips
  50.  
  51.  
  52.  
  53.   Turbo Pascal, Borland Pascal are trademarks of Borland International.
  54.  
  55.   Genius Mouse is a trademark of KUN YING ENTERPRISE CO.
  56.  
  57.   Yaniv Golan is the one to blame for the "true vga cursor" feature, he
  58.   was the one that triggered my interest in the implementation of this 
  59.   feature.
  60.  
  61.   Dave Kirsch's MOU105 package was used as a reference for the development
  62.   of the true vga cursor. I used Duncan Murdoch's port of this code to
  63.   help me identify bugs in my own code. I would like however, to point
  64.   that the code was written from scratch, and is (to my opinion) supirior
  65.   regarding things such as execution (cpu) and storage (memory) overhead.
  66.  
  67. Related Topics : Overview
  68.  
  69.  a.> use the setMouseGraph and resetMouseGraph before using the initMouse
  70.      procedure, to choose if you want text or graphics mouse support.
  71.  b.> look at the defaultHandler assembler routine, this is the heart of my
  72.      event driven applications. (use setDefaultHandler to ...).
  73.  c.> If you want to use True VGA text cursor (vgaTextGraphicCursor mode), 
  74.      call setVGATextGraphicCursor before initMouse, and be sure to call
  75.      setDefaultHandler, or provide a handler that supports mouse movement 
  76.      the way the vga true cursor handler does.
  77.  d.> Do not set or reset vgaTextGraphicCursor boolean falg by yourself, 
  78.      let the supplied set.. and reset.. procedures do that for you, 
  79.      this variable is supplied in the interface of the unit for browse
  80.      (read) purpose only, if this varible is changed not through the
  81.      suggested methods, unpredictable things can happen.
  82.  e.> In true vga cursor mode, the default handler does not trigger an event
  83.      when a "cursor changed location" condition occurs! - this is a design
  84.      feature needed to support the author's wintext library, if your code
  85.      needs to be notified of eventhappened when the mouse moves, you will
  86.      have to change the supplied default handler, or provide one of your own.
  87.  
  88. Related Topics : Overview Tech. Docs
  89.  
  90.   tpDESQ is a Turbo-Pascal unit implemantation written for TP6.0+, 
  91.  (I think it will work with TP5.0, and TP5.5 as well, but I never tried),
  92.  to the DESQview API basic functions that allow the running program to
  93.  feagure out if DESQview is active, what the virtual text buffer is, and
  94.  allows a program to run in a DESQview window. (not just as a full screen
  95.  application after you Zoom the window).
  96.  
  97. Related Topics : tpDESQ interface Overview Tech. Docs
  98.  
  99.  
  100. This is the tpDESQ unit interface :
  101.  
  102. const
  103.    DESQviewActive : boolean = false; { true if running under DESQview }
  104.    DESQviewMajor  : byte    = 0;
  105.    DESQviewMinor  : byte    = 0;
  106.  
  107. procedure detectDESQview;
  108. function getDESQviewTextBuffer : pointer;
  109. procedure DESQviewApiCall(func : word);
  110. procedure DESQviewPause;
  111. procedure DESQviewBeginCritical;
  112. procedure DESQviewEndCritical;
  113. procedure makeDESQviewAware;
  114. procedure DESQviewHercules43Lines(page : byte);
  115. function  DESQviewCurrentWindow : byte;
  116. function  DESQviewDirectScreenWrite : boolean;
  117. function  extendedDESQview : boolean; { true if xdv }
  118.  
  119. For the mouselib unit only the detectDESQview function is needed, and it is
  120. called automatically by the inclusion of this unit in the uses clause of
  121. mouselib's interface section. The DESQviewActive boolean flag is used to
  122. decide if vgaTextGraphicCursor mode (True cursor) can be entered.
  123.  
  124. Related Topics : tpDESQ Tech. Docs Overview
  125.  
  126.  
  127.   Video is a support unit for hardware adapters. This unit is used in order
  128.  to support the True vga cursor on vga screens.
  129.  
  130.   This unit is used to define and support constants related to the video
  131.  memory buffer, memory buffer size, memory adapter, font lines, and other
  132.  general video statistics.
  133.  
  134. Related Topics : Video Interface Tech. Docs Overview
  135.  
  136. This is the video unit interface :
  137.  
  138. type    fontSize = (font8,font14,font16, unknownFontSize);
  139.     adapterType = (none,mda,cga,egaMono,egaColor,vgaMono,vgaColor,mcgaMono,mcgaColor);
  140. var     textBufferOrigin  : pointer; {pointer to text buffer}
  141.         textBufferSeg     : word;
  142.     textBufferSize    : word;    {size in bytes of...}
  143.     visibleX,visibleY : byte;
  144.         fontLines         : byte;
  145. const   maxX        : integer = 79;
  146.     maxY        : integer = 24;
  147.  
  148. function queryAdapterType : adapterType;
  149. function fontCode(h : byte) : fontSize; {convert from byte to enum}
  150. function getFontSize : fontSize; {normal 25 lines,ega 25 lines,vga 25 lines}
  151. function fontHeight(f : fontSize) : byte;
  152. procedure getTextBufferStats(var BX       : byte; {visible x dimentions}
  153.                  var BY       : byte; {visible y dimentions}
  154.                  var buffSize : word {refresh buffer size}
  155.                 );
  156.  
  157. The mouselib unit uses this unit in order to validate the existence of
  158. a vga color adapter, in order to support the true vga cursor in
  159. vgaTextGraphicCursor mode.
  160.  
  161. Related Topics : Video Tech. Docs Overview
  162.  
  163.  
  164. The mouselib unit is the core of the mouse support in the mouselib 
  165. package. This unit implement the mouse driver API support, as well as
  166. the extended services and support data structures and utilities.
  167.  
  168. The inclusion of this unit ensures the automatic initialization and
  169. detection of the mouse driver, and general mouselib unit variables.
  170.  
  171. If you want to use the mouselib unit in a cursor mode which is not the
  172. default text mode hardware cursor, use the setMouseGraph and 
  173. setVgaTextGraphicCursor to use graphic or vga true cursor modes, 
  174. followed by a call to initMouse. For the use of the true vga cursor
  175. a call to setDefaultHandler is recommended.
  176.  
  177. Related Topics : Overview Tech. docs tpDESQ Video
  178.                  Constants Types Variables
  179.                  Functions Procedures
  180.  
  181.  
  182. The following constants are defined in the mouselib unit's interface :
  183.  
  184.     MOUSEINT = $33; {mouse driver interrupt}
  185.     LEFTBUTTON = 1; {bit 0}
  186.     RIGHTBUTTON = 2; {bit 1}
  187.     MIDDLEBUTTON = 4; {bit 2}
  188.  
  189.     CURSOR_LOCATION_CHANGED = 1; {event mask bits}
  190.     LEFT_BUTTON_PRESSED = 2;
  191.     LEFT_BUTTON_RELEASED = 4;
  192.     RIGHT_BUTTON_PRESSED = 8;
  193.     RIGHT_BUTTON_RELEASED = 16;
  194.     MIDDLE_BUTTON_PRESSED = 32;
  195.     MIDDLE_BUTTON_RELEASED = 64;
  196.  
  197.         click_repeat  = 10; { Recommended value for waitForRelease timeOut }
  198.     mouseTextScale = 8;
  199.  
  200. Related Topics : MouseLib Tech. Docs Overview
  201.  
  202.  
  203. The following variables are defined in the mouselib unit :
  204.  
  205.     mouse_present : boolean;
  206.     mouse_buttons : mouseType;
  207.     eventX,eventY,eventButtons : word; {any event handler should update}
  208.     eventhappened : Boolean;       {these vars to use getLastEvent }
  209.     XMotions,YMotions : word;       {per 8 pixels}
  210.     mouseCursorLevel : integer;
  211.     {if > 0 mouse cursor is visiable, otherwise not, containes the level
  212.      of showMouseCursor/hideMouseCursor}
  213.         fontPoints : byte;
  214.          LastMask : word = 0;
  215.     lastHandler : pointer = Nil;
  216.     lastCursor : grCursorType = (xH : 0; yH : 0; data : nil );
  217.         vgaTextGraphicCursor : boolean = false; { this is not the default .. }
  218.  
  219. Related Topics : MouseLib Tech. Docs Overview
  220.  
  221. The following types are defined in the mouselib unit :
  222.  
  223.     mouseType = (twoButton,threeButton,another);
  224.     buttonState = (buttonDown,buttonUp);
  225.     direction = (moveRight,moveLeft,moveUp,moveDown,noMove);
  226.     grCursorType = record
  227.         xH,yH : byte; {x,y Hot Point}
  228.         data  : pointer;  {cursor look pointer}
  229.     end;
  230.  
  231. Related Topics : MouseLib Tech. Docs Overview
  232.  
  233. The following functions are defined in the mouselib unit :
  234.  
  235. function getMouseX : word;
  236. function getMouseY : word;
  237. function getButton(Button : Byte) : buttonState;
  238. function buttonPressed : boolean;
  239. function LastXPress(Button : Byte) : word;
  240. function LastYPress(Button : Byte) : word;
  241. function ButtonPresses(Button : Byte) : word; {from last last check}
  242. function LastXRelease(Button : Byte) : word;
  243. function LastYRelease(Button : Byte) : word;
  244. function ButtonReleases(Button : Byte) : word; {from last last check}
  245. function recentXmovement : direction;
  246. function recentYmovement : direction;
  247. function getMouseSaveStateSize : word;
  248.  
  249. Related Topics : MouseLib Tech. Docs Overview
  250.  
  251. procedure initMouse; {when replacing mouse mode do that..!}
  252. procedure showMouseCursor;
  253. procedure hideMouseCursor;
  254. procedure setMouseCursor(x,y : word);
  255. procedure mouseBox(left,top,right,bottom : word); {limit mouse rectangle}
  256. procedure graphicMouseCursor(xHotPoint,yHotPoint : byte; dataOfs : pointer);
  257. procedure HardwareTextCursor(fromLine,toLine : byte);
  258. procedure softwareTextCursor(screenMask,cursorMask : word);
  259. procedure setArrowCursor;
  260. procedure setWatchCursor;
  261. procedure setUpArrowCursor;
  262. procedure setLeftArrowCursor;
  263. procedure setCheckMarkCursor;
  264. procedure setPointingHandCursor;
  265. procedure setDiagonalCrossCursor;
  266. procedure setRectangularCrossCursor;
  267. procedure setHourGlassCursor;
  268. procedure setNewWatchCursor;
  269. procedure setEventHandler(mask : word; handler    : pointer);
  270. procedure setDefaultHandler(mask : word);
  271. procedure enableLightPenEmulation;
  272. procedure disableLightPenEmulation;
  273. procedure defineSensetivity(x,y : word);
  274. procedure setHideCursorBox(left,top,right,bottom : word);
  275. procedure defineDoubleSpeedTreshHold(treshHold : word);
  276. procedure disableTreshHold;
  277. procedure defaultTreshHold;
  278. procedure setMouseGraph;
  279. procedure resetMouseGraph;
  280. procedure waitForRelease(timeOut : word);
  281. procedure swapEventHandler(mask : word; handler : pointer); { return old in lastMask and lastHandler }
  282. procedure interceptMouse; { get mouse from interrupted program, and stop it .. }
  283. procedure restoreMouse;
  284. procedure setVgaTextGraphicCursor;
  285. procedure resetVgaTextGraphicCursor;
  286.  
  287. Related Topics : MouseLib Tech. Docs Overview
  288.